package com.xm_jd.controller.goods;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xm_jd.model.dao.TianDao;
import com.xm_jd.model.entitys.user;

/**购物车选中商品Servlet
 * Servlet implementation class CarcheckedSe
 */
@WebServlet("/carcheckedse")
public class CarcheckedSe extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public CarcheckedSe() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			String cid=request.getParameter("hideattr");
			String xuan=request.getParameter("check");
	
			System.out.println("313;"+xuan);
			System.out.println("1231231;"+cid);
			TianDao dao=new TianDao();
			int num=1;
			if(xuan.equals("true")){
			dao.updatexuan(num,Integer.parseInt(cid));
			}else{
				num=0;
				dao.updatexuan(num,Integer.parseInt(cid));
			}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
